package com.dpiinc.TechPage.model;

import com.google.gson.annotations.SerializedName;

/**
 * Created by hu489_000 on 2018-07-05.
 */

public class BaseEntity<E> {

    @SerializedName("errorCode")
    private int errorCode;
    @SerializedName("result")
    private E result;

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public E getResult() {
        return result;
    }

    public void setResult(E result) {
        this.result = result;
    }

    public boolean isSuccess() {
        return errorCode == 0;
    }

    @Override
    public String toString() {
        return "BaseEntity{" +
                "errorCode=" + errorCode +
                ", result=" + result +
                '}';
    }
}
